package org.example.leetcode;

/**
 * @author: lynn
 * @Descript:
 * @date: 2021/8/5 12:05
 * @version: 1.0
 */
public class LC50 {

    public static void main(String[] args) {
        LC50 lc=new LC50();
        System.out.println(lc.myPow(0.00001,2147483647));
    }
    public double myPow(double x, int n) {
        int k=n>0?n:-n;
        return n<0?(1/pow(x,k)):pow(x,k);
    }
    public double pow(double x,int n){
        if (n==0){
            return 1;
        }else {
           return x*pow(x,n-1);
        }
    }
}
